﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace VTS.DAL
{
    public class QuanTriDAL
    {
        /// <summary>
        /// return password string from passed account. 
        /// </summary>
        /// <param name="account"></param>
        /// <returns></returns>
        public string GetPasswordByAccount(string account)
        {
            VoThiSauDataContext vtsDTX = new VoThiSauDataContext();
            
            var passwds = from tk in vtsDTX.QuanTris
                          where tk.TaiKhoan == account
                          select tk.MatKhau;

            return passwds != null && passwds.Count() > 0 ? passwds.First() : string.Empty;
        }
    }
}
